package com.sharding.jdbc.controller;

import com.sharding.jdbc.domain.User;
import com.sharding.jdbc.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述
 *
 * @author zhu_jinsheng
 * @version 1.0
 * @date 2020/8/26 17:32
 */
@Slf4j
@RestController
@RequestMapping("/user")
@Api(description = "分表分库用户操作")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/insert")
    @ApiOperation(value="用户插入", notes="用户插入")
    public String insert(@RequestBody User user) {
        return String.valueOf(userService.insert(user));
    }
}
